<?php

namespace app\admin\model\order;

use app\admin\model\Models;
use app\admin\traits\model\order\Order as OrderTraits;

class Order extends Models
{
    use OrderTraits;

    /**
     * 定义时间戳字段名
     * @var string
     */
    protected $createTime = 'create_at';

    /**
     * 取消编辑时间戳
     * @var boolean
     */
    protected $updateTime = false;

    /**
     * 设置时间戳格式
     * @var string
     */
    protected $autoWriteTimestamp = 'datetime';

    /**
     * 设置状态获取器
     * @return string
     */
    protected function getPaymentStatusTextAttr( $value, $data )
    {
        $payment_status = config('field.order.payment_status');
        return $payment_status[$data['payment_status']]??'暂无';
    }

}
